home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
3458B.ZIP
/
AMAC44B.ZIP
/
PAUSE15.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
27KB
|
567 lines
* PAUSE15.QM
* Macros To Single Step Macros
* Written by Tom Hogshead
* With Contributions by John Goodman
* 6/22/92
* Key Subfile Description
* ===== ========= =====================================================
* @1 - Make Macro a Single Step Macro by Block ( ) |chg
* @2 - Revert a Single Step Macro, Remove Pause Lines |chg
* @3 - Single Step or Revert a Single Step Macro by Line |chg
* or Block
* @4 - Comment or Un-comment All PAUSE*+'s in Block |new
* @9 - Macro @2 Paused with @1 |chg
*
* @6 {e:\up\mis005} Make Single Column Macro of QMAC Output
* @7 {e:\up\mis005} Make Single Column Macro, User Controlled
* @8 {e:\up\mis005} Make Single Column Macro
* @9 {e:\up\mis005} Convert Single Column Macro to Wide, User Controlled
* @0 {e:\up\mis005} Convert Single Column Macro to Wide, Automatic
* @j {e:\up\mis005} Join Lines with Single Space at Join Point
*
* Description
* AMACxx.ZIP
* Version History
*
*-- eoi
* (DESCRIPTION): These macros make a portion of a QEdit macro a 'single
* step' macro by entering a 'pause' before lines. Macros are included
* to revert a single step macro to normal macro operation. Macros in
* AMACxx.ZIP mis005.qm make macros single column macros to debug macros
* with these macros. Macros require QEdit v2.15.
* (AMACxx).ZIP: AMACxx.ZIP is a collection of QEdit macros I have put
* together. Most macros I have written, and John Goodman contributed
* extensively to this effort.
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Single Step a Macro By Inserting PAUSE*+ Lines
* ----------------------------------------------------------------------
* This macro converts any portion of a macro marked as a block into a
* 'single step' macro by inserting a 'pause' before each macro command
* in the block. To run, place the cursor line on the first line of the
* block, execute the macro, and at the pause, cursor down to the
* desired end of block and hit Enter. Alternatively, the block may be
* marked (open or closed) before execution as any type block.
* The macro stops when the cursor reaches and deletes first blank line.
* The following lines are not paused by @1:
* a) Lines containing any case 'pause' if no text exists after
* the pause on the same line.
* b) Lines containing PAUSE*+ or pause*+ inserted with @1 or @3.
* c) Lines containing ' jt' or ' jf' as first char in line.
* Conditional statement labels may be on the
* same or next line with or without a succeeding colon.
* d) Lines containing a colon if no text exists after the colon
* on the same line. Are assumed to be Labels.
* e) Lines containing a '*' as first character in line.
* f) Lines containing repeatcmd.
* This macro requires QEdit v2.15.
@1 macrobegin
setwordwrapmode togglewordwrap
setsoundoff *|
* ---------- Finish Marking Line Or Block If Not Marked ---------*
gotoblockend jtrue OK * If closed, go to OK
markline * If not closed, close or start mark
gotoblockend jtrue OK * If block is now closed, started open
makectrofscreen
Pause
markline * Mark end of block
OK:
setscreenoff * Turn screen off
addline * Insert blank line under block
linedown
gotoblockbeg * Pos at start of block
LOOP:
unmarkblock *:18
* setscreenon setscreenoff * Add line to see action! *:18
* ------- Test If at End of Block or Started on Blank Line ------*
isemptyline
jtrue 3A * Cursor to first black line *|
* ----------- Test If Star Is First Character In Line -----------*
firstnonwhite * Pos on first char
markcolumn *:18
cursorright * Move right one space off first char *|
find '*' return "LB" return * Search for star in block *|
jtrue 1 * If true, line commented, bypass
* ------------------- Test If Label With Colon ------------------*
markline * Re-mark line *|
endline *:18
find ':' return "LB" return * Search for colon in this line only *:15
jfalse NOCOLON * If no colon, go to NOCOLON
cursorright *ELSE colon found, move right off char
isendline * Test if text after colon
Jtrue 1 * If none, line assumed to be a cond.
* statement or Label, bypass
* --------- Test If Jtrue Statement Label Without Colon ---------*
NOCOLON:
begline
find * Search for word beginning with j_t
"j" "t" return "IL" return * in this line only
jtrue CONDITIONAL * Test if 'j' is first char in line *|
* --------- Test If Jfalse Statement Label Without Colon --------*
begline
find * Search for word beginning with j_f
"j" "f" return "IL" return * in this line only
jfalse NEXT1 * If not found, move to next test *|
CONDITIONAL: *|
firstnonwhite *|
jtrue 3 * If 'j' is first char in line, pause *|
jump 1 *ELSE cursor down to next line to test *|
* ------------ Test If Line Is Already Paused With @1 -----------*
NEXT1: *|
begline
find * Test if line is already paused with @1
"E" "*+" return "IL" return * Finds 'PAUSE_*+', any case
jtrue 2 * If found, line was paused with @1,
* bypass this and next line
* --------- Test If Line Is Already A 'Pause', Any Case ---------*
begline
find * Test if line has 'pause' in it *|
"pause" return "WLI" return *|
jfalse NO_PAUSE * If false, line has no 'pause' in it *|
markword gotoblockend *|
isendline *|
jtrue 2 * Test if 'pause' has text after it, *|
* If so, bypass this and next line *|
* ----------------- Test If Line Has Repeat_cmd -----------------*
NO_PAUSE: *|
markline * Re-mark line
begline
find * Test for Repeat_Cmd
"a" "tcm" return "IL" return
Jtrue 1 * If found, bypass this line
* ----------------------- Insert PAUSE_*+ -----------------------*
3: insertline * Insert blank line for 'pause'
3A: gotocolumn "25" return *|
"PAUSE" #42 "+" * Insert Pause
* unmarkblock * Add these two lines to *:18
* setscreenon setscreeonff * see the action! *:18
2: cursordown * Bypass line, move down to next line
1: cursordown * Move down to next line to test if blank
isemptyline
jfalse LOOP * LOOP again 'til blank line
END:
unmarkblock togglewordwrap
*
* 241 bytes Wed 05-29-1991 21:20:35 (TH to JG)
* 207 bytes Tue 06-04-1991 00:39:02 (TH implemented JG suggestions)
* 194 bytes Tue 06-04-1991 10:38:13 (TH shortened test for comments)
* 194 bytes Sun 06-23-1991 20:59:30 (TH changed find first char on line)
* 194 bytes Mon 07-08-1991 17:16:28 (TH @1)
* 196 bytes Fri 08-09-1991 02:01:44 (TH @1, Ins Off OK)
* 238 bytes Tue 11-12-1991 13:50:43 (TH @1, for conditional w/o colon's)
* 241 bytes Thu 11-14-1991 02:05:26 (TH @1, for v2.15, #3/776)
* 222 bytes Thu 02-13-1992 16:18:53 (TH @1, for all qconfig's)
* 168 bytes Wed 05-20-1992 08:30:03 (TH @1, shortened, in Amac43.zip)
* (In Amac43.zip)
* 193 bytes Mon 06-08-1992 10:57:21 (TH @1, not pause any case 'pause' *|)
* 193 bytes Mon 06-08-1992 10:57:21 (TH @1 to ALL #3/859-61)
* 200 bytes Mon 06-15-1992 17:57:11 (TH @1, changed colon routine)
* 194 bytes Thu 06-18-1992 23:02:30 (TH @1, shortened)
*
* ----------------------------------------------------------------------
* @(2) Remove PAUSE*+ Lines Inserted With @1, Reverts to Normal Operation
* ----------------------------------------------------------------------
* This macro removes all and only pauses placed with @1 from the cursor
* line to the next blank line. If no PAUSE_*+ is found after starting
* this macro, the macro deletes the next blank line it finds and stops.
* Just beware.
@2 macrobegin
setscreenoff setsoundoff *|
LOOP:
unmarkblock
* setscreenon setscreenoff * Add line to see action! *:18
markline * Markline for Find
Find
"E" "*+" return * Search for 'PAUSE_*+'
"IL" return * Finish prompt *|
jfalse NOPAUSE * If not found, go to NOPAUSE
delline *ELSE if found, delete pause line
begline * Re-position for Find in current line
jump LOOP * Loop again
NOPAUSE:
endline begline * Test if line has text
jfalse DELLINE * If blank, delete line and end macro
cursordown * Cursor down to next line
jfalse END * If false, at eof, end macro
jump LOOP * Loop again 'til blank
DELLINE:
delline * Delete blank line
END:
unmarkblock
*
* 36 bytes Tue 06-04-1991 00:26:13 (TH)
* 44 bytes Tue 06-04-1991 10:14:23 (TH |)
* 45 bytes Mon 07-08-1991 17:16:43 (TH @2)
* 46 bytes Tue 11-12-1991 15:10:11 (TH @2, use v2.15)
* 45 bytes Tue 11-12-1991 15:26:16 (TH @2, w/o v2.15, #3/776)
* 46 bytes Tue 05-19-1992 23:26:19 (TH @2, added setscreenoff)
* (In Amac43.zip)
* 41 bytes Fri 06-05-1992 13:39:05 (TH @2, shortened, added setsoundoff)
* 43 bytes Mon 06-08-1992 08:30:37 (TH @2, changed find to 'IL')
* 43 bytes Mon 06-08-1992 08:30:37 (TH @2 to ALL #3/859-61)
*
* ----------------------------------------------------------------------
* @(3) Single Step or Revert a Single Step Macro by Line or Block
* ----------------------------------------------------------------------
* This macro either adds a PAUSE*+ line above the cursor line, or
* comments/un-comments a PAUSE*+ line on either the cursor line or the
* line above the cursor line. If a line block is marked before
* invoking, either open or closed, all lines in the block are paused,
* un-paused, or bypassed as if separately. Lines that have been paused
* or un-paused with @3 are not paused or paused, the same as if @1 were
* invoked. See @1 discussion for what lines are *not* paused with @3.
* Lines that have already been paused, un-paused or commented out with
* @1 or @3, are handled by @3 as follows:
* a. PAUSED: If the cursor line or the line above the cursor line
* has already been paused with @1 or @3 when @3 is invoked, the
* paused line will be commented out (un-paused) by inserting a
* preceding asterisk and the pause will be lower cased to
* 'pause*+'.
* b. PAUSED and COMMENTED: If the cursor line, or the line above
* the cursor line, has already been paused with @1 or @3 and
* the paused line has been *commented out* with a preceding
* asterisk, the commented paused line will be un-commented
* and the 'pause*+' re-capitalized to 'PAUSE*+' to highlight.
* c. REMOVING LINES CONTAINING 'PAUSE*+': Pause lines inserted with
* @3 may be removed with @2 by inserting a blank line after the
* last pause to be removed and then invoking @2 at or above the
* first paused line to be removed.
@3 macrobegin
setscreenoff
setwordwrapmode togglewordwrap
setsoundoff setinsmode
* --------- Close Block if Not Marked, Insert Eob Marker --------*
nextfile * Maintain screen pos cur file
horizontalwindow
editfile escape * For all Qconfig's
nextfile
closewindow prevfile * Closes block if open
gotoblockend
jfalse NO_ADDLINE
addline begline #173 #175 * Insert end of block markers*:15
lineup * Re-position cursor
gotoblockbeg
NO_ADDLINE:
isemptyline
jtrue 3A
LOOP:
* ----------- Test if Star is First Character in Line -----------*
firstnonwhite
unmarkblock *:18
* setscreenon setscreenoff * Add line to see action! *:18
markcolumn *:18
endline markcolumn *:18
firstnonwhite *:18
cursorright * Move one char rt of first char
find '*' return "LB" return * Test if line is commented
jfalse NO_STAR
find "E" "*+" return "IL" return * If commented, test if paused
jfalse 1
shiftleft shiftright * Uncomment if paused
markword upper * Upper case it for visibility
cursordown
jump 1
NO_STAR:
* ------------------- Test if Label with Colon ------------------*
unmarkblock markline *:18
endline *:18
find ':' return "ILB" return * Search for colon in line only *:15
jfalse NOCOLON
cursorright
isendline
Jtrue 1 * Bypass if text after colon
NOCOLON:
* --------- Test if Jtrue Statement Label without Colon ---------*
begline
find "j" "t" return "IL" return
jtrue CONDITIONAL
* --------- Test if Jfalse Statement Label without Colon --------*
begline
find "j" "f" return "IL" return
jfalse NEXT1
CONDITIONAL:
firstnonwhite
jtrue 3 * Pause if 'j' not first char
jump 1 *ELSE don't 'Pause'
NEXT1:
* ----------------- Test if Line has Repeat_Cmd -----------------*
begline
find "a" "tcm" return "IL" return
jtrue 1
* --------- Test if Line or Line Above is Already Paused --------*
begline
find "E" "*+" return "IL" return * Test if PAUSE_*+
jtrue IS_PAUSE
cursorup * Pos to test line above
unmarkblock markline
repeatfind
jtrue IS_PAUSE
cursordown * Return to starting line
jump LAST_TEST
IS_PAUSE:
firstnonwhite *:18
unmarkblock markcolumn *:18
endline markcolumn *:18
firstnonwhite *:18
cursorright
find '*' return "LB" return * Test if PAUSE_*+ is commented
jfalse COMMENT
UNCOMMENT:
shiftleft shiftright * Uncomment if commented
wordright
markword upper * Upper case for visibility
cursordown * Return to starting line
jump 1
COMMENT:
unmarkblock *:18
shiftleft begline '*' * Comment if uncommented
wordright
markword lower * Lower case for visibility
cursordown * Return to starting line
jump 1
* --------- Test if Line is Already a 'Pause', Any Case ---------*
LAST_TEST:
begline
unmarkblock markline
find "pause" return "WLI" return * To find 'pause', any case
jfalse NOT_pause
markword
gotoblockend
isendline * Test if text after 'pause'
jtrue 1 * Don't pause if no text after
NOT_pause:
* --------------- Insert PAUSE_*+ and Bypass Lines --------------*
3: insertline * Insert blank line for 'PAUSE_*+'
3A: gotocolumn "25" return
"PAUSE" "*+" * Insert PAUSE_*+
linedown * Re-position screen
1: cursordown * Move down to next line
findreplace * Test if past eob, maintains
#173 #175 return #173 #175 return * cursor pos, 'Find' does not*:15
'N' return
jtrue LOOP: * Loop again until past eob marker
DELMARK:
find return 'G' return * Jump to eob marker
jfalse END
delline * Remove eob marker
scrolldown
END:
unmarkblock togglewordwrap
begline
*
* 73 bytes Tue 06-04-1991 02:04:12 (TH)
* 73 bytes Mon 07-08-1991 17:17:12 (TH @4)
* 75 bytes Sun 11-17-1991 21:15:58 (TH @4, move to next line, Insert on)
* 75 bytes Sun 11-17-1991 21:25:10 (TH @4)
* 76 bytes Mon 05-04-1992 17:26:12 (TH @3, added setscreenoff)
* 117 bytes Wed 05-20-1992 10:22:04 (TH @3, handles line above cursor line)
* (In Amac43.zip)
* 289 bytes Mon 06-08-1992 21:31:32 (TH @3, pause like @1, also unpause)
* 289 bytes Mon 06-08-1992 21:31:32 (TH @3 to ALL #3/859-61)
* 295 bytes Mon 06-15-1992 08:38:18 (TH @3, double end of block markers)
* 302 bytes Mon 06-15-1992 17:33:11 (TH @3, changed colon routine)
* 305 bytes Thu 06-18-1992 23:01:49 (TH @3, misc)
*
* ----------------------------------------------------------------------
* @(4) Comment or Un-comment all PAUSE*+'s in Block
* ----------------------------------------------------------------------
* This macro has two functions:
* All PAUSE*+ lines in a block that are *not* commented out will be
* commented out by inserting a preceding asterisk in col 1, and
* lower cased.
* All PAUSE*+ lines in a block that are commented out will be
* un-commented by removing the asterisk in col 1, and upper cased.
* If no PAUSE*+ lines exist in the block, nothing is changed in the
* macro. If a line block is not marked before invoking, either open or
* closed, the macro pauses for the user to select the end of block.
* This macro is useful for quickly switching states of a macro from
* single step to normal when all lines in the block have not been
* paused with either @1 or @3.
@4 macrobegin
setwordwrapmode togglewordwrap
setsoundoff setinsmode
* ----- Mark Line Or Block If Not Marked, Insert Eob Marker -----*
gotoblockend jtrue OK markline
gotoblockend jtrue OK
makectrofscreen
Pause
markline
OK:
setscreenoff
addline begline #173 #175 * Insert end of block markers
lineup * Re-position cursor
gotoblockbeg
NO_ADDLINE:
isemptyline
jtrue 1
LOOP:
* ----------- Test if Star is First Character in Line -----------*
firstnonwhite
unmarkblock
* setscreenon setscreenoff * Add line to see action! *:18
markcolumn
cursorright * Move one char rt of first char
find '*' return "LB" return * Test if line is commented
jfalse NO_STAR
unmarkblock markline
find "E" "*+" return "IL" return * If commented, test if paused
jfalse 1
* ---------------------- Uncomment PAUSE_*+ ---------------------*
UNCOMMENT:
shiftleft shiftright * Uncomment if paused
markword upper * Upper case it for visibility
cursordown
jump 1
NO_STAR:
* --------- Test if Line is Already Paused with PAUSE_*+ --------*
begline
unmarkblock markline *:18
find "E" "*+" return "IL" return * Test if PAUSE_*+
jfalse 1 *:18
COMMENT:
shiftleft begline '*' * Comment if uncommented
wordright
markword lower * Lower case for visibility
* ----------- Re-position, Remove End of Block Markers ----------*
cursordown * Return to starting line
1: cursordown * Move down to next line
findreplace * Test if past eob, maintains
#173 #175 return #173 #175 return * cursor pos, 'Find' does not
'N' return
jtrue LOOP: * Loop again until past eob marker
DELMARK:
find return 'G' return * Jump to eob marker
jfalse END
delline * Removwe eob marker
scrolldown
END:
unmarkblock togglewordwrap
begline
*
* 133 bytes Thu 06-18-1992 23:01:30 (TH @4)
*
* ----------------------------------------------------------------------
* @(9) Macro @2 Paused With @1, Removes PAUSES "Single Step"
* ----------------------------------------------------------------------
* This macro is macro @2 paused with @1 to show how pause lines are
* inserted.
@9 macrobegin
* setscreenoff setsoundoff
LOOP:
PAUSE*+
unmarkblock markline * Markline for Find
PAUSE*+
Find
PAUSE*+
"E" "*+" return * Search for 'PAUSE_*+'
PAUSE*+
"IL" return * Finish prompt
jfalse NOPAUSE * If not found, go to NOPAUSE
PAUSE*+
delline *ELSE if found, delete pause line
PAUSE*+
begline * Re-position for Find in current line
jump LOOP * Loop again
NOPAUSE:
PAUSE*+
endline begline * Test if line has text
jfalse DELLINE * If blank, delete line and end macro
PAUSE*+
cursordown * Cursor down to next line
jfalse END * If false, at eof, end macro
PAUSE*+
jump LOOP * Loop again 'til blank
DELLINE:
PAUSE*+
delline * Delete blank line
END:
PAUSE*+
unmarkblock
*
* 36 bytes Tue 06-04-1991 00:26:13 (TH)
* 44 bytes Tue 06-04-1991 10:14:23 (TH |)
* 45 bytes Mon 07-08-1991 17:16:43 (TH @2)
* 46 bytes Tue 11-12-1991 15:10:11 (TH @2, use v2.15)
* 45 bytes Tue 11-12-1991 15:26:16 (TH @2, w/o v2.15, #3/776)
* 46 bytes Mon 05-04-1992 17:26:42 (TH @2, added setscreenoff *|)
*--
* 42 bytes Fri 05-31-1991 22:13:40 (TH)
* 42 bytes Mon 07-08-1991 17:16:52 (TH @3)
* 61 bytes Tue 11-12-1991 15:21:38 (TH @3)
* 58 bytes Tue 05-19-1992 23:16:52 (TH @9, actual, no change)
* 52 bytes Mon 06-15-1992 18:12:25 (TH @9, updated with latest @2)
* (Version) History
* ------------------
* 1.0 - Initial release. 7/10/91
* 1.1 - Modified @1 for Insert On or Off. 8/9/91
* 1.2 - Modified @1 for labels succeeding conditional statements 11/12/91
* w/ or w/o colon following label. Updated @3.
* - Modified @1 for QEdit v2.15. Added reference to mis005. 11/14/91
* - Modified @3 and @4. 11/17/91
* - Sent #3/776. 11/21/91
* 1.3 - Corrected @1 for qconfig set to insert lines below cursor. 1/9/92
* - Modified @1 to handle conditional statements correctly. 2/13/92
* - In AMAC42.ZIP. 3/28/92
* 1.4 - Added setscreenoff to @2 and @4. 5/4/92
* - Shortened @1. 5/20/92
* - Changed @3 to @9, @4 to @3. 5/20/92
* (In Amac43.zip.)
* 1.5 - Modified @1 to not pause case insensitive 'pause'. 5/29/92
* - Added setsoundoff to @2/3. 6/4/92
* - Modified @3 to be more versatile - pause and unpause. 6/4/92
* - Added @4. 6/15/92
* - Changed eob markers in @3 and @4. 6/15/92
* - Changed colon routine in @1 and @3. 6/15/92
* - Updated @9 with latest version of @2. 6/15/92
*
*
*
*
*
*
* eof